package cn.sicnu.cs.employment.exception;

/**
 * 没用到，在 cn.sicnu.cs.employment.security.rest.RestAuthenticationFailureHandler
 * 已经做了返回信息
 */
//public class SimpleAccessDeniedHandler implements AccessDeniedHandler {
//    @Override
//    public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException, ServletException {
//        HashMap<String, String> map = new HashMap<>(2);
//        map.put("uri", request.getRequestURI());
//        map.put("message" , "认证失败");
//        response.setStatus(HttpServletResponse.SC_FORBIDDEN);
//        response.setCharacterEncoding("utf-8");
//        response.setContentType(MediaType.APPLICATION_JSON_VALUE);
//        ObjectMapper objectMapper = new ObjectMapper();
//        String resBody = objectMapper.writeValueAsString(map);
//        PrintWriter printWriter = response.getWriter();
//        printWriter.print(resBody);
//        printWriter.flush();
//        printWriter.close();
//    }
//}